package com.wyh.service;


import com.wyh.common.response.PageInfo;
import com.wyh.common.result.R;
import com.wyh.entity.MsgChatRoom;
import com.wyh.request.MsgChatRoomRequest;

import java.util.List;

/**
 * 群组接口
 *
 * @author WangYuHang
 * @date 2024-03-08
 */
public interface IMsgChatRoomService {
    /**
     * 新增群聊
     *
     * @param param param
     * @return MsgChatRoom
     */
    MsgChatRoom add(MsgChatRoomRequest param);


    /**
     * 根据id查找群聊
     * @param chatRoomId
     * @return
     */
    R<MsgChatRoom> queryById(String chatRoomId);

    /**
     * 解散群聊
     * @param chatroomId
     * @return
     */
    R<String>  dissolveChatRoom(String chatroomId);

    /**
     * 获取群聊列表
     * @return
     */
    R<List<MsgChatRoom>> queryList();


    /**
     * 加入群聊
     * @param chatRoomId
     * @param userId
     * @return
     */
    R<String>  addPerson(String chatRoomId,String userId);


    /**
     * 将用户移出群聊
     * @param chatRoomId
     * @param userId
     * @return
     */
    R<String> moveOutChatRoom(String chatRoomId,String userId);

    /**
     * 判断群聊是否已满
     * @param chatRoomId
     * @return
     */
    Boolean queryIsMax(String chatRoomId);


    /**
     * 判断用户是否在群里
     * @param userId
     * @param chatRoomId
     * @return
     */
    Boolean queryIsExist(String userId,String chatRoomId);


    /**
     * 判断是否超出创建群聊限制
     * @param userId
     * @return
     */
    Boolean queryIsOutChatRoomCount(String userId);
    /**
     * 删除
     *
     * @param id id
     * @return boolean
     */
    boolean delete(Integer id);

    /**
     * 批量删除
     *
     * @param ids ids
     * @return boolean
     */
    boolean deleteBatch(List<Integer> ids);

    /**
     * 更新
     *
     * @param param param
     * @return boolean
     */
    boolean update(MsgChatRoomRequest param);

    /**
     * 查询单条数据，Specification模式
     *
     * @param chatRoomId
     * @return MsgChatRoom
     */
    MsgChatRoom getById(String chatRoomId);

    /**
     * 查询分页数据
     *
     * @param param param
     * @return PageInfo<MsgChatRoom>
     */
    PageInfo<MsgChatRoom> pageList(MsgChatRoomRequest param);


    /**
     * 查询所有数据
     *
     * @return List<MsgChatRoom>
     */
    List<MsgChatRoom> list(MsgChatRoomRequest param);
}
